package com.zy.design.pattern.decorator;

/**
 * @author zhaoyi
 * @date 2021/4/29 15:46
 * 装饰器-
 * 增强了原本的驾驶功能
 */
public class ADecoratorCarByAutomatic implements ICar {

    private ICar car;

    public ADecoratorCarByAutomatic(ICar car) {
        this.car = car;
    }

    @Override
    public void drive() {
        System.out.println("我添加了自动驾驶的功能");
        car.drive();
    }
}
